package in.muton.edushare.helper;

import java.util.ArrayList;

import wicket.contrib.tinymce.TinyMceBehavior;
import wicket.contrib.tinymce.settings.TinyMCESettings;
import wicket.contrib.tinymce.settings.TinyMCESettings.Align;
import wicket.contrib.tinymce.settings.TinyMCESettings.Location;
import wicket.contrib.tinymce.settings.TinyMCESettings.Theme;
import wicket.contrib.tinymce.settings.TinyMCESettings.Toolbar;


public class TinyMCEHelper {
	
	public static TinyMceBehavior getDefaultTinyMCEBehavior(){
		TinyMCESettings tmceSettings = new TinyMCESettings(Theme.advanced);

		tmceSettings.setToolbarLocation(Location.top);
		tmceSettings.setToolbarAlign(Align.left);
		ArrayList<wicket.contrib.tinymce.settings.Button> tmceButtons = new ArrayList<wicket.contrib.tinymce.settings.Button>();
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.bold);
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.italic);
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.underline);
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.strikethrough);
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.separator);
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.fontselect);
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.fontsizeselect);
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.separator);
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.bullist);
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.numlist);
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.separator);
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.link);
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.unlink);
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.separator);
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.forecolor);
		tmceButtons.add(wicket.contrib.tinymce.settings.Button.backcolor);
		
		tmceSettings.setToolbarButtons(Toolbar.first,tmceButtons);
		tmceSettings.setToolbarButtons(Toolbar.second, new ArrayList<wicket.contrib.tinymce.settings.Button>());
		tmceSettings.setToolbarButtons(Toolbar.third, new ArrayList<wicket.contrib.tinymce.settings.Button>());
		tmceSettings.setToolbarButtons(Toolbar.fourth, new ArrayList<wicket.contrib.tinymce.settings.Button>());
	
	
		TinyMceBehavior tmceBehavior = new TinyMceBehavior(tmceSettings);
		
		return tmceBehavior;
	}
}
